package com.openlab.service.moveCar.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.openlab.service.moveCar.dto.ConcatList;
import com.openlab.service.moveCar.dto.FindList;
import com.openlab.service.moveCar.eneity.UserCar;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
public interface UserCarMapper extends BaseMapper<UserCar> {
    @Select("select ejyy_wechat_mp_user.phone," +
            "ejyy_user_car.car_number "+
            "from ejyy_user_car left join ejyy_wechat_mp_user on ejyy_wechat_mp_user.id=ejyy_user_car.wechat_mp_user_id "+
            "where ejyy_user_car.car_number=#{car_number}")
    ConcatList haveConcat(@Param("car_number")String car_number);

    @Select("select  ejyy_wechat_mp_user.phone "+
            "from ejyy_user_car left join ejyy_wechat_mp_user on ejyy_wechat_mp_user.id=ejyy_user_car.wechat_mp_user_id "+
            "where ejyy_user_car.car_number=#{car_number} and ejyy_user_car.status=-121")
    FindList getFindList(@Param("car_number")String car_number);
}
